<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0,maximum-scale=1.0,user-scalable=no,minimum-scale=1.0">
    <title>flex布局子项常见属性</title>
    <style>
        /* flex 布局子项常见属性 
         1.align-self: 改变子元素的属性
           值: auto start end center baseline stretch
         2.order: 排序
           值: -5 -4 -3 -2 -1 0 1 2 3 4 5
         3.flex: 1 2 3（分蛋糕）
*/
        section {
            display: flex;
            width: 60%;
            height: 150px;
            background-color: #ccc;
            margin: 100px auto;
            /* 让三个子盒子一起下来了 */
            /* align-items: flex-end; */
        }

        section div:nth-child(1) {
            width: 100px;
            height: 100px;
            background-color: #f00;
        }

        section div:nth-child(2) {
            flex: 1;
            background-color: green;
        }

        section div:nth-child(3) {
            width: 100px;
            height: 100px;
            background-color: #f00;
            /* 改变自身对齐方式 */
            align-self: flex-end;
        }

        p {
            display: flex;
            width: 60%;
            height: 150px;
            background-color: #ccc;
            margin: 0 auto;
        }

        p span {
            flex: 1;
            /* background-color: #f00; */
        }

        p span:nth-child(2) {
            flex: 2;
            /* 默认的是0，-1比0小，-2比-1小，-3比-2小，以此类推所以在前面 */
            order: -1;
            background-color: #f00;
        }
    </style>
</head>

<body>
    <section>
        <div></div>
        <div></div>
        <div></div>
    </section>
    <p>
        <span>1</span><span>2</span><span>3</span>
    </p>
</body>

</html>